﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Data.Database;
using Business.Entities;

namespace Negocio
{
    public class PersonaLogic : BusinessLogic
    {
       Data.Database.PersonaAdapter personasdata;

        public PersonaLogic()
        {
            personasdata = new Data.Database.PersonaAdapter();
        }

        public List<Persona> GetAllAlumnos()
        {
            return personasdata.GetAllAlumnos();
               
        }

        public List<Persona> GetAllProfesores()
        {
            return personasdata.GetAllProfesores();

        }

        public Persona getOne(int ID)
        {
            return personasdata.GetOne(ID);
        }
        /// <summary>
        /// Guarda los cambios en la persona
        /// </summary>
        /// <param name="Per"></param>
        public void Save(Business.Entities.Persona Per)
        {
            personasdata.Save(Per);
        }

        public enum Tipo
        { 
            Docente,
            Alumno,
        }

        public void delete(int id)
        {
            personasdata.Delete(id);
        }

        public void save(Business.Entities.Persona per)
        {
            personasdata.Save(per);
        }
    }
}